/*
 export * from './lang'
 export * from './env'
 export * from './dom'
 export * from './props'
 export * from './event'
 export * from './guid'
 */
import _cx from 'classnames'
import _keyCode from './keyCode'
import _slotMixin from './slotMixin'
import _guid from './guid'
import _event from './event'
import _props from './props'
import _dom from './dom'

export const cx = _cx;
export const keyCode = _keyCode;
export const slotMixin = _slotMixin;
export const guid = _guid;
export const event = _event;
export const props = _props;
export const dom = _dom;

export function getPlainObject(vueObject) {
  return JSON.parse(JSON.stringify(vueObject))
}

export function parseJSON(data) {
  var rs = null;
  if(typeof data === 'object'){
    return data;
  }
  if(/ERR_/.test(data)) {
    rs = JSON.parse(data.substr(4));
  } else {
    rs = JSON.parse(data);
  }
  return rs;
}

export function isSuccess(data) {
  var rs = parseJSON(data);
  if(rs.code && rs.msg) {// 同时出现code,msg说明服务端响应错误
    return false;
  } else {
    return true;
  }
}
